package com.bistu.xiong.common;

import android.content.ContentResolver;
import android.content.Context;
import android.net.Uri;

import javax.sql.DataSource;
/**
 * Created by XiongXiaoJun on 2017/12/04.
 */

public class Common {
    /**
     * 一些不变的参数
     */
    public interface  Constance{
        //手机的正则，11位手机号
        String REGEX_MOBILE = "[1][3,4,5,7,8][0-9]{9}";

        // 基础的网络请求地址
        String API_URL = "http://123.206.19.11:8080/TuLingRobot/";
        String TULING_API_URL = "http://www.tuling123.com/openapi/";
        String API_KEY = "01c2c20a161e4ec68fa1a91959111f3c";

    }
    public static Uri getUriFromDrawable(int drawableId, Context context){
        return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"
                + context.getResources().getResourcePackageName(drawableId) + "/"
                + context.getResources().getResourceTypeName(drawableId) + "/"
                + context.getResources().getResourceEntryName(drawableId));
    }
}
